const state = {
  defaultActive: '/personalCenter/personInfo',
  isCollapse: false,
  items: [{
    title: '店铺概览',
    index: '/personalCenter/personInfo',
    icon: 'el-icon-tickets',
  }, {
    title: '店铺管理',
    index: '/personalCenter/sellerManager',
    icon: 'el-icon-s-home',
  }, {
    title: '商品管理',
    index: '/personalCenter/productsManager',
    icon: 'el-icon-s-grid',
  }, {
    title: '订单管理',
    index: '/personalCenter/orderManager',
    icon: 'el-icon-money',
  }, {
    title: '数据概览',
    index: '/personalCenter/charts',
    icon: 'el-icon-data-analysis',
    childrens: [{
      title: '销量数据',
      index: '/personalCenter/pieChart',
      // icon: 'el-icon-data-analysis',
    }, {
      title: '访问数据',
      index: '/personalCenter/mixChart',
      // icon: 'el-icon-data-analysis',
    }]
  }]
}
const mutations = {
  CHENGE_ACTIVE_SIDEBAR: (state, index) => {
    state.defaultActive = index
  },
  CHANGE_COLLAPSE: (state) => {
    state.isCollapse = !state.isCollapse
  },
  SET_ISCOLLAPSE: (state, isCollapse) => {
    state.isCollapse = isCollapse
  }
}
const actions = {
  changeCollapse({
    commit
  }) {
    return new Promise((resolve, reject) => {
      commit('CHANGE_COLLAPSE')
    })
  }
}
export default {
  state,
  mutations,
  actions
}
